Function Subspace :: _r literal

template <::sus::ops::__private::RangeLiteralDeducer<false> D>
auto operator""_r() -> auto

Constructs a usize range from a literal.

The constructed range satisfies the RangeBounds<usize> concept. Because usize is unsigned, numbers may not be negative.

The syntax is a string (in double quotes) containing:

  • start..end for a range including start and excluding end. This returns a sus::ops::Range<usize>.
  • start..=end for a range including start and including end. This returns a sus::ops::Range<usize>.
  • start.. for a range including start and never ending. This returns a sus::ops::RangeFrom<usize>.
  • ..end for a range including everything up end. This returns a sus::ops::RangeTo<usize>.
  • ..=end for a range including everything up and including end. This returns a sus::ops::RangeTo<usize>.
  • .. for a range that has no bounds at all. Typically for a slicing range to indicate the entire slice. This returns a sus::ops::RangeFull<usize>.

Examples

sus_check("1..4"_r).start == 1u);
sus_check(("1..4"_r).finish == 4u);
sus_check(("1..=4"_r).finish == 5u);